package com.qijian.maindata.domain.query;

import com.baomidou.mybatisplus.annotation.TableName;
import com.qijian.common.utils.mybatis.WhereType;
import com.qijian.common.utils.mybatis.WhereTypeEnum;
import lombok.Data;
import lombok.ToString;

import java.util.Set;

@Data
@ToString
@TableName("qm_hd_danger_zjxny")
public class QmDangerQuery {

    @WhereType(filed = "create_chn_name")
    private String manageNickName;

    @WhereType(func = "hidden_danger_type_name IS NOT NULL AND hidden_danger_type_name != \"一般隐患\"")
    private Boolean isMajorHiddenDanger;

    @WhereType(filed = "hidden_danger_area",type = WhereTypeEnum.LIKE)
    private String HiddenDangerArea;

    @WhereType(filed = "hidden_danger_desc",type = WhereTypeEnum.LIKE)
    private String HiddenDangerDesc;

    @WhereType(filed = "corrective_user_or_dept",type = WhereTypeEnum.LIKE)
    private String CorrectiveUserOrDept;

    @WhereType(filed = "create_date", type = WhereTypeEnum.BETWEEN)
    private String[] CreateDate;

    @WhereType(filed = "LGD_Name")
    private String lgdName;

    @WhereType(filed = "mix_lgd_name")
    private String mix_lgd_name;

    @WhereType(filed = "corrective_top_dept_name")
    private String analysisHiddenDangerArea;

    @WhereType(func = "date_format(create_date, '%Y-%m') >= {1}")
    private String startTime;

    @WhereType(func = "{1} >= date_format(create_date, '%Y-%m')")
    private String endTime;

    @WhereType(func = "DATE_FORMAT(create_date,'%Y') = {1}")
    private Integer year;

    @WhereType(func = "date_format(create_date,'%Y-%m') = {1}")
    private Integer ym;


    @WhereType(filed = "id", type = WhereTypeEnum.IN)
    private Set<Long> ids;

    @WhereType(filed = "user_id", type = WhereTypeEnum.EQ)
    private Long userId;
}
